import axios from 'axios'

const request = axios.create({
  baseURL: 'https://restapi.amap.com/v3',
  timeout: 10000,
  headers: {
    'Content-Type': 'application/json',
  },
})

request.interceptors.request.use((config) => {
  config.params = {
    ...config.params,
      key: import.meta.env.VITE_AMAP_KEY || '3cd50123fb6d07df838ffcdd5102da18'
  }
  return config
})

export default request
